
<h1><span class="yiyi-st" id="yiyi-13">numpy.ma.mean</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.mean.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.mean.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="data">
<dt id="numpy.ma.mean"><span class="yiyi-st" id="yiyi-14"> <code class="descclassname">numpy.ma.</code><code class="descname">mean</code><span class="sig-paren">(</span><em>self</em>, <em>axis=None</em>, <em>dtype=None</em>, <em>out=None</em>, <em>keepdims=&lt;class numpy._globals._NoValue at 0x7faefc173ef0&gt;</em><span class="sig-paren">)</span><em class="property"> = &lt;numpy.ma.core._frommethod instance&gt;</em></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-15">返回沿给定轴的数组元素的平均值。</span></p>
<p><span class="yiyi-st" id="yiyi-16">屏蔽的条目被忽略，并且不是有限的结果元素将被屏蔽。</span></p>
<p><span class="yiyi-st" id="yiyi-17">有关完整文档，请参阅<a class="reference internal" href="numpy.mean.html#numpy.mean" title="numpy.mean"><code class="xref py py-obj docutils literal"><span class="pre">numpy.mean</span></code></a>。</span></p>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-18">也可以看看</span></p>
<dl class="last docutils">
<dt><span class="yiyi-st" id="yiyi-19"><code class="xref py py-obj docutils literal"><span class="pre">ndarray.mean</span></code></span></dt>
<dd><span class="yiyi-st" id="yiyi-20">ndarrays的相应函数</span></dd>
<dt><span class="yiyi-st" id="yiyi-21"><a class="reference internal" href="numpy.mean.html#numpy.mean" title="numpy.mean"><code class="xref py py-obj docutils literal"><span class="pre">numpy.mean</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-22">等效功能</span></dd>
<dt><span class="yiyi-st" id="yiyi-23"><a class="reference internal" href="numpy.ma.average.html#numpy.ma.average" title="numpy.ma.average"><code class="xref py py-obj docutils literal"><span class="pre">numpy.ma.average</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-24">加权平均。</span></dd>
</dl>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-25">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ma</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">],</span> <span class="n">mask</span><span class="o">=</span><span class="p">[</span><span class="kc">False</span><span class="p">,</span> <span class="kc">False</span><span class="p">,</span> <span class="kc">True</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span>
<span class="go">masked_array(data = [1 2 --],</span>
<span class="go">             mask = [False False  True],</span>
<span class="go">       fill_value = 999999)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span>
<span class="go">1.5</span>
</pre></div>
</div>
</dd></dl>
